﻿
namespace Patterns4Net.Core.AbstractionLevel
{
    using System.Collections.Generic;
    using System.Linq;
    using Patterns4Net.Attributes;

    public static class AbstractionLevelExtensions
    {
        public static bool IsHigher(this AbstractionLevel level1, AbstractionLevel level2)
        {
            return level1 < level2;
        }

        public static bool IsHigherOrEqual(this AbstractionLevel level1, AbstractionLevel level2)
        {
            return level1 <= level2;
        }

        public static AbstractionLevel GetHigherLevel(this IEnumerable<AbstractionLevel> levels)
        {
            return levels.OrderBy(x => x).First();
        }
    }
}
